********Table I.1********

*Load data
cd "$reploc/data/created_data"
use indo_full, clear

sort pidlink ifls
drop if ifls==.
keep if panel==1


sort pidlink ifls
foreach var of varlist rbuc_garefined rbuc grbrprovAvg_lam0co3 grbrprovSD_lam0co3 inflation{
gen `var'dif=`var'-`var'[_n-1] if ifls==5 & pidlink==pidlink[_n-1]
} 

*Do this analysis for full sample
gen eithrisk=0
replace eithrisk=1 if rbucdif!=. 

egen fullsample=total(eithrisk), by(pidlink)
keep if fullsample==1

keep rbuc rbuc_nga gambleaverse gambleaverserbucBund5 b3acp3 rav_score religiosity muslim pidlink ifls
reshape wide rbuc rbuc_nga gambleaverse gambleaverserbucBund5 b3acp3 rav_score religiosity muslim, i(pidlink) j(ifls)

tab rbuc4 rbuc5, row

cd "$reploc/results"
tabout rbuc4 rbuc5 using TableI1.tex, cells(row) replace 
